package io.coderyeah.ymcc.feign.client;


import io.coderyeah.ymcc.domain.CourseDoc;
import io.coderyeah.ymcc.feign.fallback.SearchClientFallback;
import io.coderyeah.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author lqs
 * @date 2022/10/20 16:06
 */
@FeignClient(value = "service-search", fallbackFactory = SearchClientFallback.class)
public interface SearchServiceClient {

    @PostMapping("/search/save")
    JSONResult save(@RequestBody CourseDoc doc);

    @DeleteMapping("/search/delete/{id}")
    JSONResult deleteById(@PathVariable Long id);
}
